Merge branch 'master' of github.com:jamesagnew/hapi-fhir
This commit is contained in:
commit
9bee09efcd
|
@ -91,6 +91,46 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC
|
|||
return getCodeElement().equals(theCoding.getCodeElement()) && getSystemElement().equals(theCoding.getSystemElement());
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if <code>this</code> Coding matches a search for the coding specified by <code>theSearchParam</code>, according
|
||||
* to the following:
|
||||
* <ul>
|
||||
* <li>[parameter]=[namespace]|[code] matches a code/value in the given system namespace</li>
|
||||
* <li>[parameter]=[code] matches a code/value irrespective of it's system namespace</li>
|
||||
* <li>[parameter]=|[code] matches a code/value that has no system namespace</li>
|
||||
* </ul>
|
||||
* @param theSearchParam - coding to test <code>this</code> against
|
||||
* @return true if the coding matches, false otherwise
|
||||
*/
|
||||
public boolean matchesToken(BaseCodingDt theSearchParam) {
|
||||
if (theSearchParam.isSystemPresent()) {
|
||||
if (theSearchParam.isSystemBlank()) {
|
||||
// [parameter]=|[code] matches a code/value that has no system namespace
|
||||
if (isSystemPresent() && !isSystemBlank())
|
||||
return false;
|
||||
} else {
|
||||
// [parameter]=[namespace]|[code] matches a code/value in the given system namespace
|
||||
if (!isSystemPresent())
|
||||
return false;
|
||||
if (!getSystemElement().equals(theSearchParam.getSystemElement()))
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// [parameter]=[code] matches a code/value irrespective of it's system namespace
|
||||
// (nothing to do for system for this case)
|
||||
}
|
||||
|
||||
return getCodeElement().equals(theSearchParam.getCodeElement());
|
||||
}
|
||||
|
||||
private boolean isSystemPresent() {
|
||||
return !getSystemElement().isEmpty();
|
||||
}
|
||||
|
||||
private boolean isSystemBlank() {
|
||||
return isSystemPresent() && getSystemElement().getValueAsString().equals("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value for <b>code</b> (Symbol in syntax defined by the system)
|
||||
*
|
||||
|
@ -109,4 +149,5 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC
|
|||
*/
|
||||
public abstract BaseCodingDt setSystem(String theUri);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -94,4 +94,15 @@ public class TokenOrListParam extends BaseOrListParam<TokenParam> {
|
|||
return new TokenParam();
|
||||
}
|
||||
|
||||
public boolean doesCodingListMatch(List<? extends BaseCodingDt> theCodings) {
|
||||
List<BaseCodingDt> paramCodings = getListAsCodings();
|
||||
for (BaseCodingDt coding : theCodings) {
|
||||
for (BaseCodingDt paramCoding : paramCodings) {
|
||||
if (coding.matchesToken(paramCoding)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,4 +33,4 @@ public interface IServerConformanceProvider<T extends IBaseResource> {
|
|||
*/
|
||||
public abstract T getServerConformance(HttpServletRequest theRequest);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ public class RestfulServer extends HttpServlet {
|
|||
/**
|
||||
* Count length of URL string, but treating unescaped sequences (e.g. ' ') as their unescaped equivalent (%20)
|
||||
*/
|
||||
private int escapedLength(String theServletPath) {
|
||||
protected int escapedLength(String theServletPath) {
|
||||
int delta = 0;
|
||||
for (int i = 0; i < theServletPath.length(); i++) {
|
||||
char next = theServletPath.charAt(i);
|
||||
|
@ -479,13 +479,11 @@ public class RestfulServer extends HttpServlet {
|
|||
String operation = null;
|
||||
String compartment = null;
|
||||
|
||||
String requestPath = requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
|
||||
String requestPath = getRequestPath(requestFullPath, servletContextPath, servletPath);
|
||||
if (requestPath.length() > 0 && requestPath.charAt(0) == '/') {
|
||||
requestPath = requestPath.substring(1);
|
||||
}
|
||||
|
||||
fhirServerBase = getServerBaseForRequest(theRequest);
|
||||
|
||||
String completeUrl = StringUtils.isNotBlank(theRequest.getQueryString()) ? requestUrl + "?" + theRequest.getQueryString() : requestUrl.toString();
|
||||
|
||||
Map<String, String[]> params = new HashMap<String, String[]>(theRequest.getParameterMap());
|
||||
|
@ -534,6 +532,7 @@ public class RestfulServer extends HttpServlet {
|
|||
operation = Constants.PARAM_HISTORY;
|
||||
}
|
||||
} else if (nextString.startsWith("_")) {
|
||||
//FIXME: this would be untrue for _meta/_delete
|
||||
if (operation != null) {
|
||||
throw new InvalidRequestException("URL Path contains two operations (part beginning with _): " + requestPath);
|
||||
}
|
||||
|
@ -1499,4 +1498,16 @@ public class RestfulServer extends HttpServlet {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows users of RestfulServer to override the getRequestPath method to let them build their custom request path
|
||||
* implementation
|
||||
*
|
||||
* @param requestFullPath the full request path
|
||||
* @param servletContextPath the servelet context path
|
||||
* @param servletPath the servelet path
|
||||
* @return created resource path
|
||||
*/
|
||||
protected String getRequestPath(String requestFullPath, String servletContextPath, String servletPath) {
|
||||
return requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,90 +20,90 @@ package org.hl7.fhir.instance.formats;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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;
|
||||
import org.hl7.fhir.instance.model.DateAndTime;
|
||||
|
||||
public abstract class FormatUtilities {
|
||||
public static final String ID_REGEX = "[A-Za-z0-9\\-\\.]{1,64}";
|
||||
protected static final String FHIR_NS = "http://hl7.org/fhir";
|
||||
protected static final String ATOM_NS = "http://www.w3.org/2005/Atom";
|
||||
protected static final String GDATA_NS = "http://schemas.google.com/g/2005";
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
protected String toString(DateAndTime value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
import org.hl7.fhir.instance.model.DateAndTime;
|
||||
|
||||
public abstract class FormatUtilities {
|
||||
public static final String ID_REGEX = "[A-Za-z0-9\\-\\.]{1,64}";
|
||||
protected static final String FHIR_NS = "http://hl7.org/fhir";
|
||||
protected static final String ATOM_NS = "http://www.w3.org/2005/Atom";
|
||||
protected static final String GDATA_NS = "http://schemas.google.com/g/2005";
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
protected String toString(DateAndTime value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Age extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Age copy() {
|
||||
Age dst = new Age();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Age typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Age extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Age copy() {
|
||||
Age dst = new Age();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Age typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,479 +20,479 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* Prospective warnings of potential issues when providing care to the patient.
|
||||
*/
|
||||
@ResourceDef(name="Alert", profile="http://hl7.org/fhir/Profile/Alert")
|
||||
public class Alert extends DomainResource {
|
||||
|
||||
public enum AlertStatus implements FhirEnum {
|
||||
/**
|
||||
* A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert.
|
||||
*/
|
||||
ACTIVE,
|
||||
/**
|
||||
* The alert does not need to be displayed any more.
|
||||
*/
|
||||
INACTIVE,
|
||||
/**
|
||||
* The alert was added in error, and should no longer be displayed.
|
||||
*/
|
||||
ENTEREDINERROR,
|
||||
/**
|
||||
* added to help the parsers
|
||||
*/
|
||||
NULL;
|
||||
|
||||
public static final AlertStatusEnumFactory ENUM_FACTORY = new AlertStatusEnumFactory();
|
||||
|
||||
public static AlertStatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
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 IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'");
|
||||
}
|
||||
@Override
|
||||
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 "";
|
||||
case INACTIVE: return "";
|
||||
case ENTEREDINERROR: return "";
|
||||
default: return "?";
|
||||
}
|
||||
}
|
||||
public String getDefinition() {
|
||||
switch (this) {
|
||||
case ACTIVE: return "A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert.";
|
||||
case INACTIVE: return "The alert does not need to be displayed any more.";
|
||||
case ENTEREDINERROR: return "The alert 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 AlertStatusEnumFactory implements EnumFactory<AlertStatus> {
|
||||
public AlertStatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("active".equals(codeString))
|
||||
return AlertStatus.ACTIVE;
|
||||
if ("inactive".equals(codeString))
|
||||
return AlertStatus.INACTIVE;
|
||||
if ("entered in error".equals(codeString))
|
||||
return AlertStatus.ENTEREDINERROR;
|
||||
throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'");
|
||||
}
|
||||
public String toCode(AlertStatus code) throws IllegalArgumentException {
|
||||
if (code == AlertStatus.ACTIVE)
|
||||
return "active";
|
||||
if (code == AlertStatus.INACTIVE)
|
||||
return "inactive";
|
||||
if (code == AlertStatus.ENTEREDINERROR)
|
||||
return "entered in error";
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier assigned to the alert for external use (outside the FHIR environment).
|
||||
*/
|
||||
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the alert for external use (outside the FHIR environment)." )
|
||||
protected List<Identifier> identifier;
|
||||
|
||||
/**
|
||||
* Allows an alert to be divided into different categories like clinical, administrative etc.
|
||||
*/
|
||||
@Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1)
|
||||
@Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an alert to be divided into different categories like clinical, administrative etc." )
|
||||
protected CodeableConcept category;
|
||||
|
||||
/**
|
||||
* Supports basic workflow.
|
||||
*/
|
||||
@Child(name="status", type={CodeType.class}, order=1, min=1, max=1)
|
||||
@Description(shortDefinition="active | inactive | entered in error", formalDefinition="Supports basic workflow." )
|
||||
protected Enumeration<AlertStatus> status;
|
||||
|
||||
/**
|
||||
* The person who this alert concerns.
|
||||
*/
|
||||
@Child(name="subject", type={Patient.class}, order=2, min=1, max=1)
|
||||
@Description(shortDefinition="Who is alert about?", formalDefinition="The person who this alert concerns." )
|
||||
protected Reference subject;
|
||||
|
||||
/**
|
||||
* The actual object that is the target of the reference (The person who this alert concerns.)
|
||||
*/
|
||||
protected Patient subjectTarget;
|
||||
|
||||
/**
|
||||
* The person or device that created the alert.
|
||||
*/
|
||||
@Child(name="author", type={Practitioner.class, Patient.class, Device.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="Alert creator", formalDefinition="The person or device that created the alert." )
|
||||
protected Reference author;
|
||||
|
||||
/**
|
||||
* The actual object that is the target of the reference (The person or device that created the alert.)
|
||||
*/
|
||||
protected Resource authorTarget;
|
||||
|
||||
/**
|
||||
* The textual component of the alert to display to the user.
|
||||
*/
|
||||
@Child(name="note", type={StringType.class}, order=4, min=1, max=1)
|
||||
@Description(shortDefinition="Text of alert", formalDefinition="The textual component of the alert to display to the user." )
|
||||
protected StringType note;
|
||||
|
||||
private static final long serialVersionUID = -655685828L;
|
||||
|
||||
public Alert() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Alert(Enumeration<AlertStatus> status, Reference subject, StringType note) {
|
||||
super();
|
||||
this.status = status;
|
||||
this.subject = subject;
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #identifier} (Identifier assigned to the alert for external use (outside the FHIR environment).)
|
||||
*/
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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 alert 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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #category} (Allows an alert to be divided into different categories like clinical, administrative etc.)
|
||||
*/
|
||||
public CodeableConcept getCategory() {
|
||||
if (this.category == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.category");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.category = new CodeableConcept();
|
||||
return this.category;
|
||||
}
|
||||
|
||||
public boolean hasCategory() {
|
||||
return this.category != null && !this.category.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #category} (Allows an alert to be divided into different categories like clinical, administrative etc.)
|
||||
*/
|
||||
public Alert 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<AlertStatus> getStatusElement() {
|
||||
if (this.status == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.status");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.status = new Enumeration<AlertStatus>();
|
||||
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 Alert setStatusElement(Enumeration<AlertStatus> value) {
|
||||
this.status = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Supports basic workflow.
|
||||
*/
|
||||
public AlertStatus getStatus() {
|
||||
return this.status == null ? null : this.status.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value Supports basic workflow.
|
||||
*/
|
||||
public Alert setStatus(AlertStatus value) {
|
||||
if (this.status == null)
|
||||
this.status = new Enumeration<AlertStatus>(AlertStatus.ENUM_FACTORY);
|
||||
this.status.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #subject} (The person who this alert concerns.)
|
||||
*/
|
||||
public Reference getSubject() {
|
||||
if (this.subject == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.subject");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.subject = new Reference();
|
||||
return this.subject;
|
||||
}
|
||||
|
||||
public boolean hasSubject() {
|
||||
return this.subject != null && !this.subject.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #subject} (The person who this alert concerns.)
|
||||
*/
|
||||
public Alert 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 who this alert concerns.)
|
||||
*/
|
||||
public Patient getSubjectTarget() {
|
||||
if (this.subjectTarget == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.subject");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.subjectTarget = new Patient();
|
||||
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 who this alert concerns.)
|
||||
*/
|
||||
public Alert setSubjectTarget(Patient value) {
|
||||
this.subjectTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #author} (The person or device that created the alert.)
|
||||
*/
|
||||
public Reference getAuthor() {
|
||||
if (this.author == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.author");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.author = new Reference();
|
||||
return this.author;
|
||||
}
|
||||
|
||||
public boolean hasAuthor() {
|
||||
return this.author != null && !this.author.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #author} (The person or device that created the alert.)
|
||||
*/
|
||||
public Alert 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 or device that created the alert.)
|
||||
*/
|
||||
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 or device that created the alert.)
|
||||
*/
|
||||
public Alert setAuthorTarget(Resource value) {
|
||||
this.authorTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value
|
||||
*/
|
||||
public StringType getNoteElement() {
|
||||
if (this.note == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.note");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.note = new StringType();
|
||||
return this.note;
|
||||
}
|
||||
|
||||
public boolean hasNoteElement() {
|
||||
return this.note != null && !this.note.isEmpty();
|
||||
}
|
||||
|
||||
public boolean hasNote() {
|
||||
return this.note != null && !this.note.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value
|
||||
*/
|
||||
public Alert setNoteElement(StringType value) {
|
||||
this.note = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The textual component of the alert to display to the user.
|
||||
*/
|
||||
public String getNote() {
|
||||
return this.note == null ? null : this.note.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value The textual component of the alert to display to the user.
|
||||
*/
|
||||
public Alert setNote(String value) {
|
||||
if (this.note == null)
|
||||
this.note = new StringType();
|
||||
this.note.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> childrenList) {
|
||||
super.listChildren(childrenList);
|
||||
childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the alert for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier));
|
||||
childrenList.add(new Property("category", "CodeableConcept", "Allows an alert to be divided into different categories like clinical, administrative etc.", 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("subject", "Reference(Patient)", "The person who this alert concerns.", 0, java.lang.Integer.MAX_VALUE, subject));
|
||||
childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the alert.", 0, java.lang.Integer.MAX_VALUE, author));
|
||||
childrenList.add(new Property("note", "string", "The textual component of the alert to display to the user.", 0, java.lang.Integer.MAX_VALUE, note));
|
||||
}
|
||||
|
||||
public Alert copy() {
|
||||
Alert dst = new Alert();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
for (Identifier i : identifier)
|
||||
dst.identifier.add(i.copy());
|
||||
};
|
||||
dst.category = category == null ? null : category.copy();
|
||||
dst.status = status == null ? null : status.copy();
|
||||
dst.subject = subject == null ? null : subject.copy();
|
||||
dst.author = author == null ? null : author.copy();
|
||||
dst.note = note == null ? null : note.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Alert typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty())
|
||||
&& (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty())
|
||||
&& (note == null || note.isEmpty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Alert;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="patient", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" )
|
||||
public static final String SP_PATIENT = "patient";
|
||||
@SearchParamDefinition(name="subject", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" )
|
||||
public static final String SP_SUBJECT = "subject";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* Prospective warnings of potential issues when providing care to the patient.
|
||||
*/
|
||||
@ResourceDef(name="Alert", profile="http://hl7.org/fhir/Profile/Alert")
|
||||
public class Alert extends DomainResource {
|
||||
|
||||
public enum AlertStatus implements FhirEnum {
|
||||
/**
|
||||
* A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert.
|
||||
*/
|
||||
ACTIVE,
|
||||
/**
|
||||
* The alert does not need to be displayed any more.
|
||||
*/
|
||||
INACTIVE,
|
||||
/**
|
||||
* The alert was added in error, and should no longer be displayed.
|
||||
*/
|
||||
ENTEREDINERROR,
|
||||
/**
|
||||
* added to help the parsers
|
||||
*/
|
||||
NULL;
|
||||
|
||||
public static final AlertStatusEnumFactory ENUM_FACTORY = new AlertStatusEnumFactory();
|
||||
|
||||
public static AlertStatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
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 IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'");
|
||||
}
|
||||
@Override
|
||||
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 "";
|
||||
case INACTIVE: return "";
|
||||
case ENTEREDINERROR: return "";
|
||||
default: return "?";
|
||||
}
|
||||
}
|
||||
public String getDefinition() {
|
||||
switch (this) {
|
||||
case ACTIVE: return "A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert.";
|
||||
case INACTIVE: return "The alert does not need to be displayed any more.";
|
||||
case ENTEREDINERROR: return "The alert 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 AlertStatusEnumFactory implements EnumFactory<AlertStatus> {
|
||||
public AlertStatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
if (codeString == null || "".equals(codeString))
|
||||
if (codeString == null || "".equals(codeString))
|
||||
return null;
|
||||
if ("active".equals(codeString))
|
||||
return AlertStatus.ACTIVE;
|
||||
if ("inactive".equals(codeString))
|
||||
return AlertStatus.INACTIVE;
|
||||
if ("entered in error".equals(codeString))
|
||||
return AlertStatus.ENTEREDINERROR;
|
||||
throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'");
|
||||
}
|
||||
public String toCode(AlertStatus code) throws IllegalArgumentException {
|
||||
if (code == AlertStatus.ACTIVE)
|
||||
return "active";
|
||||
if (code == AlertStatus.INACTIVE)
|
||||
return "inactive";
|
||||
if (code == AlertStatus.ENTEREDINERROR)
|
||||
return "entered in error";
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier assigned to the alert for external use (outside the FHIR environment).
|
||||
*/
|
||||
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the alert for external use (outside the FHIR environment)." )
|
||||
protected List<Identifier> identifier;
|
||||
|
||||
/**
|
||||
* Allows an alert to be divided into different categories like clinical, administrative etc.
|
||||
*/
|
||||
@Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1)
|
||||
@Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an alert to be divided into different categories like clinical, administrative etc." )
|
||||
protected CodeableConcept category;
|
||||
|
||||
/**
|
||||
* Supports basic workflow.
|
||||
*/
|
||||
@Child(name="status", type={CodeType.class}, order=1, min=1, max=1)
|
||||
@Description(shortDefinition="active | inactive | entered in error", formalDefinition="Supports basic workflow." )
|
||||
protected Enumeration<AlertStatus> status;
|
||||
|
||||
/**
|
||||
* The person who this alert concerns.
|
||||
*/
|
||||
@Child(name="subject", type={Patient.class}, order=2, min=1, max=1)
|
||||
@Description(shortDefinition="Who is alert about?", formalDefinition="The person who this alert concerns." )
|
||||
protected Reference subject;
|
||||
|
||||
/**
|
||||
* The actual object that is the target of the reference (The person who this alert concerns.)
|
||||
*/
|
||||
protected Patient subjectTarget;
|
||||
|
||||
/**
|
||||
* The person or device that created the alert.
|
||||
*/
|
||||
@Child(name="author", type={Practitioner.class, Patient.class, Device.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="Alert creator", formalDefinition="The person or device that created the alert." )
|
||||
protected Reference author;
|
||||
|
||||
/**
|
||||
* The actual object that is the target of the reference (The person or device that created the alert.)
|
||||
*/
|
||||
protected Resource authorTarget;
|
||||
|
||||
/**
|
||||
* The textual component of the alert to display to the user.
|
||||
*/
|
||||
@Child(name="note", type={StringType.class}, order=4, min=1, max=1)
|
||||
@Description(shortDefinition="Text of alert", formalDefinition="The textual component of the alert to display to the user." )
|
||||
protected StringType note;
|
||||
|
||||
private static final long serialVersionUID = -655685828L;
|
||||
|
||||
public Alert() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Alert(Enumeration<AlertStatus> status, Reference subject, StringType note) {
|
||||
super();
|
||||
this.status = status;
|
||||
this.subject = subject;
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #identifier} (Identifier assigned to the alert for external use (outside the FHIR environment).)
|
||||
*/
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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 alert 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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #category} (Allows an alert to be divided into different categories like clinical, administrative etc.)
|
||||
*/
|
||||
public CodeableConcept getCategory() {
|
||||
if (this.category == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.category");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.category = new CodeableConcept();
|
||||
return this.category;
|
||||
}
|
||||
|
||||
public boolean hasCategory() {
|
||||
return this.category != null && !this.category.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #category} (Allows an alert to be divided into different categories like clinical, administrative etc.)
|
||||
*/
|
||||
public Alert 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<AlertStatus> getStatusElement() {
|
||||
if (this.status == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.status");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.status = new Enumeration<AlertStatus>();
|
||||
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 Alert setStatusElement(Enumeration<AlertStatus> value) {
|
||||
this.status = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Supports basic workflow.
|
||||
*/
|
||||
public AlertStatus getStatus() {
|
||||
return this.status == null ? null : this.status.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value Supports basic workflow.
|
||||
*/
|
||||
public Alert setStatus(AlertStatus value) {
|
||||
if (this.status == null)
|
||||
this.status = new Enumeration<AlertStatus>(AlertStatus.ENUM_FACTORY);
|
||||
this.status.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #subject} (The person who this alert concerns.)
|
||||
*/
|
||||
public Reference getSubject() {
|
||||
if (this.subject == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.subject");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.subject = new Reference();
|
||||
return this.subject;
|
||||
}
|
||||
|
||||
public boolean hasSubject() {
|
||||
return this.subject != null && !this.subject.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #subject} (The person who this alert concerns.)
|
||||
*/
|
||||
public Alert 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 who this alert concerns.)
|
||||
*/
|
||||
public Patient getSubjectTarget() {
|
||||
if (this.subjectTarget == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.subject");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.subjectTarget = new Patient();
|
||||
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 who this alert concerns.)
|
||||
*/
|
||||
public Alert setSubjectTarget(Patient value) {
|
||||
this.subjectTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #author} (The person or device that created the alert.)
|
||||
*/
|
||||
public Reference getAuthor() {
|
||||
if (this.author == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.author");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.author = new Reference();
|
||||
return this.author;
|
||||
}
|
||||
|
||||
public boolean hasAuthor() {
|
||||
return this.author != null && !this.author.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #author} (The person or device that created the alert.)
|
||||
*/
|
||||
public Alert 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 or device that created the alert.)
|
||||
*/
|
||||
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 or device that created the alert.)
|
||||
*/
|
||||
public Alert setAuthorTarget(Resource value) {
|
||||
this.authorTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value
|
||||
*/
|
||||
public StringType getNoteElement() {
|
||||
if (this.note == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Alert.note");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.note = new StringType();
|
||||
return this.note;
|
||||
}
|
||||
|
||||
public boolean hasNoteElement() {
|
||||
return this.note != null && !this.note.isEmpty();
|
||||
}
|
||||
|
||||
public boolean hasNote() {
|
||||
return this.note != null && !this.note.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value
|
||||
*/
|
||||
public Alert setNoteElement(StringType value) {
|
||||
this.note = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The textual component of the alert to display to the user.
|
||||
*/
|
||||
public String getNote() {
|
||||
return this.note == null ? null : this.note.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value The textual component of the alert to display to the user.
|
||||
*/
|
||||
public Alert setNote(String value) {
|
||||
if (this.note == null)
|
||||
this.note = new StringType();
|
||||
this.note.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> childrenList) {
|
||||
super.listChildren(childrenList);
|
||||
childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the alert for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier));
|
||||
childrenList.add(new Property("category", "CodeableConcept", "Allows an alert to be divided into different categories like clinical, administrative etc.", 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("subject", "Reference(Patient)", "The person who this alert concerns.", 0, java.lang.Integer.MAX_VALUE, subject));
|
||||
childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the alert.", 0, java.lang.Integer.MAX_VALUE, author));
|
||||
childrenList.add(new Property("note", "string", "The textual component of the alert to display to the user.", 0, java.lang.Integer.MAX_VALUE, note));
|
||||
}
|
||||
|
||||
public Alert copy() {
|
||||
Alert dst = new Alert();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
for (Identifier i : identifier)
|
||||
dst.identifier.add(i.copy());
|
||||
};
|
||||
dst.category = category == null ? null : category.copy();
|
||||
dst.status = status == null ? null : status.copy();
|
||||
dst.subject = subject == null ? null : subject.copy();
|
||||
dst.author = author == null ? null : author.copy();
|
||||
dst.note = note == null ? null : note.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Alert typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty())
|
||||
&& (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty())
|
||||
&& (note == null || note.isEmpty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Alert;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="patient", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" )
|
||||
public static final String SP_PATIENT = "patient";
|
||||
@SearchParamDefinition(name="subject", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" )
|
||||
public static final String SP_SUBJECT = "subject";
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,482 +20,482 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* 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=-1, min=0, max=1)
|
||||
@Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." )
|
||||
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=0, min=0, max=1)
|
||||
@Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." )
|
||||
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=1, min=0, max=1)
|
||||
@Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." )
|
||||
protected Base64BinaryType data;
|
||||
|
||||
/**
|
||||
* An alternative location where the data can be accessed.
|
||||
*/
|
||||
@Child(name="url", type={UriType.class}, order=2, min=0, max=1)
|
||||
@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={IntegerType.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." )
|
||||
protected IntegerType size;
|
||||
|
||||
/**
|
||||
* The calculated hash of the data using SHA-1. Represented using base64.
|
||||
*/
|
||||
@Child(name="hash", type={Base64BinaryType.class}, order=4, min=0, max=1)
|
||||
@Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." )
|
||||
protected Base64BinaryType hash;
|
||||
|
||||
/**
|
||||
* A label or set of text to display in place of the data.
|
||||
*/
|
||||
@Child(name="title", type={StringType.class}, order=5, min=0, max=1)
|
||||
@Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." )
|
||||
protected StringType title;
|
||||
|
||||
private static final long serialVersionUID = 483430116L;
|
||||
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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 IntegerType getSizeElement() {
|
||||
if (this.size == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Attachment.size");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.size = new IntegerType();
|
||||
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(IntegerType 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 ? null : this.size.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value The number of bytes of data that make up this attachment.
|
||||
*/
|
||||
public Attachment setSize(int value) {
|
||||
if (value == -1)
|
||||
this.size = null;
|
||||
else {
|
||||
if (this.size == null)
|
||||
this.size = new IntegerType();
|
||||
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();
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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", "integer", "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));
|
||||
}
|
||||
|
||||
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();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Attachment typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* 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=-1, min=0, max=1)
|
||||
@Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." )
|
||||
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=0, min=0, max=1)
|
||||
@Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." )
|
||||
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=1, min=0, max=1)
|
||||
@Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." )
|
||||
protected Base64BinaryType data;
|
||||
|
||||
/**
|
||||
* An alternative location where the data can be accessed.
|
||||
*/
|
||||
@Child(name="url", type={UriType.class}, order=2, min=0, max=1)
|
||||
@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={IntegerType.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." )
|
||||
protected IntegerType size;
|
||||
|
||||
/**
|
||||
* The calculated hash of the data using SHA-1. Represented using base64.
|
||||
*/
|
||||
@Child(name="hash", type={Base64BinaryType.class}, order=4, min=0, max=1)
|
||||
@Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." )
|
||||
protected Base64BinaryType hash;
|
||||
|
||||
/**
|
||||
* A label or set of text to display in place of the data.
|
||||
*/
|
||||
@Child(name="title", type={StringType.class}, order=5, min=0, max=1)
|
||||
@Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." )
|
||||
protected StringType title;
|
||||
|
||||
private static final long serialVersionUID = 483430116L;
|
||||
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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 IntegerType getSizeElement() {
|
||||
if (this.size == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Attachment.size");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.size = new IntegerType();
|
||||
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(IntegerType 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 ? null : this.size.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value The number of bytes of data that make up this attachment.
|
||||
*/
|
||||
public Attachment setSize(int value) {
|
||||
if (value == -1)
|
||||
this.size = null;
|
||||
else {
|
||||
if (this.size == null)
|
||||
this.size = new IntegerType();
|
||||
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();
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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", "integer", "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));
|
||||
}
|
||||
|
||||
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();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Attachment typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,383 +20,383 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* (informative) A container for slot(s) of time that may be available for booking appointments.
|
||||
*/
|
||||
@ResourceDef(name="Availability", profile="http://hl7.org/fhir/Profile/Availability")
|
||||
public class Availability extends DomainResource {
|
||||
|
||||
/**
|
||||
* External Ids for this item.
|
||||
*/
|
||||
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." )
|
||||
protected List<Identifier> identifier;
|
||||
|
||||
/**
|
||||
* The schedule type can be used for the categorization of healthcare services or other appointment types.
|
||||
*/
|
||||
@Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types", formalDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types." )
|
||||
protected List<CodeableConcept> type;
|
||||
|
||||
/**
|
||||
* The resource this availability 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={}, order=1, min=1, max=1)
|
||||
@Description(shortDefinition="The resource this availability 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 availability 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 availability 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 availability 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=2, min=0, max=1)
|
||||
@Description(shortDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist). 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 availability 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=3, min=0, max=1)
|
||||
@Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." )
|
||||
protected StringType comment;
|
||||
|
||||
/**
|
||||
* When this availability was created, or last revised.
|
||||
*/
|
||||
@Child(name="lastModified", type={DateTimeType.class}, order=4, min=0, max=1)
|
||||
@Description(shortDefinition="When this availability was created, or last revised", formalDefinition="When this availability was created, or last revised." )
|
||||
protected DateTimeType lastModified;
|
||||
|
||||
private static final long serialVersionUID = -461457234L;
|
||||
|
||||
public Availability() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Availability(Reference actor) {
|
||||
super();
|
||||
this.actor = actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #identifier} (External Ids for this item.)
|
||||
*/
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.)
|
||||
*/
|
||||
public List<CodeableConcept> getType() {
|
||||
if (this.type == null)
|
||||
this.type = new ArrayList<CodeableConcept>();
|
||||
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 schedule type can be used for the categorization of healthcare services or other appointment types.)
|
||||
*/
|
||||
// syntactic sugar
|
||||
public CodeableConcept addType() { //3
|
||||
CodeableConcept t = new CodeableConcept();
|
||||
if (this.type == null)
|
||||
this.type = new ArrayList<CodeableConcept>();
|
||||
this.type.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #actor} (The resource this availability 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 Availability.actor");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.actor = new Reference();
|
||||
return this.actor;
|
||||
}
|
||||
|
||||
public boolean hasActor() {
|
||||
return this.actor != null && !this.actor.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #actor} (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.)
|
||||
*/
|
||||
public Availability 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 availability 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 availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.)
|
||||
*/
|
||||
public Availability setActorTarget(Resource value) {
|
||||
this.actorTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #planningHorizon} (The period of time that the slots that are attached to this availability 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 Availability.planningHorizon");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.planningHorizon = new Period();
|
||||
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 availability 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 Availability 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 Availability.comment");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.comment = new StringType();
|
||||
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 Availability 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 Availability 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 #lastModified} (When this availability was created, or last revised.). 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 Availability.lastModified");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.lastModified = new DateTimeType();
|
||||
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} (When this availability was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value
|
||||
*/
|
||||
public Availability setLastModifiedElement(DateTimeType value) {
|
||||
this.lastModified = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return When this availability was created, or last revised.
|
||||
*/
|
||||
public Date getLastModified() {
|
||||
return this.lastModified == null ? null : this.lastModified.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value When this availability was created, or last revised.
|
||||
*/
|
||||
public Availability setLastModified(Date value) {
|
||||
if (value == null)
|
||||
this.lastModified = null;
|
||||
else {
|
||||
if (this.lastModified == null)
|
||||
this.lastModified = new DateTimeType();
|
||||
this.lastModified.setValue(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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("type", "CodeableConcept", "The schedule type can be used for the categorization of healthcare services or other appointment types.", 0, java.lang.Integer.MAX_VALUE, type));
|
||||
childrenList.add(new Property("actor", "Reference(Any)", "The resource this availability 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 availability 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));
|
||||
childrenList.add(new Property("lastModified", "dateTime", "When this availability was created, or last revised.", 0, java.lang.Integer.MAX_VALUE, lastModified));
|
||||
}
|
||||
|
||||
public Availability copy() {
|
||||
Availability dst = new Availability();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
for (Identifier i : identifier)
|
||||
dst.identifier.add(i.copy());
|
||||
};
|
||||
if (type != null) {
|
||||
dst.type = new ArrayList<CodeableConcept>();
|
||||
for (CodeableConcept i : type)
|
||||
dst.type.add(i.copy());
|
||||
};
|
||||
dst.actor = actor == null ? null : actor.copy();
|
||||
dst.planningHorizon = planningHorizon == null ? null : planningHorizon.copy();
|
||||
dst.comment = comment == null ? null : comment.copy();
|
||||
dst.lastModified = lastModified == null ? null : lastModified.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Availability typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty())
|
||||
&& (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty())
|
||||
&& (comment == null || comment.isEmpty()) && (lastModified == null || lastModified.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Availability;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="actor", path="Availability.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find an availability for", type="reference" )
|
||||
public static final String SP_ACTOR = "actor";
|
||||
@SearchParamDefinition(name="date", path="Availability.planningHorizon", description="Search for availability resources that have a period that contains this date specified", type="date" )
|
||||
public static final String SP_DATE = "date";
|
||||
@SearchParamDefinition(name="type", path="Availability.type", description="The type of appointments that can be booked into associated slot(s)", type="token" )
|
||||
public static final String SP_TYPE = "type";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* (informative) A container for slot(s) of time that may be available for booking appointments.
|
||||
*/
|
||||
@ResourceDef(name="Availability", profile="http://hl7.org/fhir/Profile/Availability")
|
||||
public class Availability extends DomainResource {
|
||||
|
||||
/**
|
||||
* External Ids for this item.
|
||||
*/
|
||||
@Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." )
|
||||
protected List<Identifier> identifier;
|
||||
|
||||
/**
|
||||
* The schedule type can be used for the categorization of healthcare services or other appointment types.
|
||||
*/
|
||||
@Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types", formalDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types." )
|
||||
protected List<CodeableConcept> type;
|
||||
|
||||
/**
|
||||
* The resource this availability 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={}, order=1, min=1, max=1)
|
||||
@Description(shortDefinition="The resource this availability 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 availability 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 availability 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 availability 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=2, min=0, max=1)
|
||||
@Description(shortDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist). 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 availability 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=3, min=0, max=1)
|
||||
@Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." )
|
||||
protected StringType comment;
|
||||
|
||||
/**
|
||||
* When this availability was created, or last revised.
|
||||
*/
|
||||
@Child(name="lastModified", type={DateTimeType.class}, order=4, min=0, max=1)
|
||||
@Description(shortDefinition="When this availability was created, or last revised", formalDefinition="When this availability was created, or last revised." )
|
||||
protected DateTimeType lastModified;
|
||||
|
||||
private static final long serialVersionUID = -461457234L;
|
||||
|
||||
public Availability() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Availability(Reference actor) {
|
||||
super();
|
||||
this.actor = actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #identifier} (External Ids for this item.)
|
||||
*/
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.)
|
||||
*/
|
||||
public List<CodeableConcept> getType() {
|
||||
if (this.type == null)
|
||||
this.type = new ArrayList<CodeableConcept>();
|
||||
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 schedule type can be used for the categorization of healthcare services or other appointment types.)
|
||||
*/
|
||||
// syntactic sugar
|
||||
public CodeableConcept addType() { //3
|
||||
CodeableConcept t = new CodeableConcept();
|
||||
if (this.type == null)
|
||||
this.type = new ArrayList<CodeableConcept>();
|
||||
this.type.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #actor} (The resource this availability 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 Availability.actor");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.actor = new Reference();
|
||||
return this.actor;
|
||||
}
|
||||
|
||||
public boolean hasActor() {
|
||||
return this.actor != null && !this.actor.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #actor} (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.)
|
||||
*/
|
||||
public Availability 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 availability 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 availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.)
|
||||
*/
|
||||
public Availability setActorTarget(Resource value) {
|
||||
this.actorTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #planningHorizon} (The period of time that the slots that are attached to this availability 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 Availability.planningHorizon");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.planningHorizon = new Period();
|
||||
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 availability 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 Availability 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 Availability.comment");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.comment = new StringType();
|
||||
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 Availability 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 Availability 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 #lastModified} (When this availability was created, or last revised.). 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 Availability.lastModified");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.lastModified = new DateTimeType();
|
||||
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} (When this availability was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value
|
||||
*/
|
||||
public Availability setLastModifiedElement(DateTimeType value) {
|
||||
this.lastModified = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return When this availability was created, or last revised.
|
||||
*/
|
||||
public Date getLastModified() {
|
||||
return this.lastModified == null ? null : this.lastModified.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value When this availability was created, or last revised.
|
||||
*/
|
||||
public Availability setLastModified(Date value) {
|
||||
if (value == null)
|
||||
this.lastModified = null;
|
||||
else {
|
||||
if (this.lastModified == null)
|
||||
this.lastModified = new DateTimeType();
|
||||
this.lastModified.setValue(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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("type", "CodeableConcept", "The schedule type can be used for the categorization of healthcare services or other appointment types.", 0, java.lang.Integer.MAX_VALUE, type));
|
||||
childrenList.add(new Property("actor", "Reference(Any)", "The resource this availability 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 availability 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));
|
||||
childrenList.add(new Property("lastModified", "dateTime", "When this availability was created, or last revised.", 0, java.lang.Integer.MAX_VALUE, lastModified));
|
||||
}
|
||||
|
||||
public Availability copy() {
|
||||
Availability dst = new Availability();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
for (Identifier i : identifier)
|
||||
dst.identifier.add(i.copy());
|
||||
};
|
||||
if (type != null) {
|
||||
dst.type = new ArrayList<CodeableConcept>();
|
||||
for (CodeableConcept i : type)
|
||||
dst.type.add(i.copy());
|
||||
};
|
||||
dst.actor = actor == null ? null : actor.copy();
|
||||
dst.planningHorizon = planningHorizon == null ? null : planningHorizon.copy();
|
||||
dst.comment = comment == null ? null : comment.copy();
|
||||
dst.lastModified = lastModified == null ? null : lastModified.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Availability typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty())
|
||||
&& (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty())
|
||||
&& (comment == null || comment.isEmpty()) && (lastModified == null || lastModified.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Availability;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="actor", path="Availability.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find an availability for", type="reference" )
|
||||
public static final String SP_ACTOR = "actor";
|
||||
@SearchParamDefinition(name="date", path="Availability.planningHorizon", description="Search for availability resources that have a period that contains this date specified", type="date" )
|
||||
public static final String SP_DATE = "date";
|
||||
@SearchParamDefinition(name="type", path="Availability.type", description="The type of appointments that can be booked into associated slot(s)", type="token" )
|
||||
public static final String SP_TYPE = "type";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,110 +20,110 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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<Extension> modifierExtension;
|
||||
|
||||
private static final long serialVersionUID = -1431673179L;
|
||||
|
||||
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<Extension> getModifierExtension() {
|
||||
if (this.modifierExtension == null)
|
||||
this.modifierExtension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.modifierExtension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public abstract BackboneElement copy();
|
||||
|
||||
public void copyValues(BackboneElement dst) {
|
||||
if (modifierExtension != null) {
|
||||
dst.modifierExtension = new ArrayList<Extension>();
|
||||
for (Extension i : modifierExtension)
|
||||
dst.modifierExtension.add(i.copy());
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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<Extension> modifierExtension;
|
||||
|
||||
private static final long serialVersionUID = -1431673179L;
|
||||
|
||||
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<Extension> getModifierExtension() {
|
||||
if (this.modifierExtension == null)
|
||||
this.modifierExtension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.modifierExtension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public abstract BackboneElement copy();
|
||||
|
||||
public void copyValues(BackboneElement dst) {
|
||||
if (modifierExtension != null) {
|
||||
dst.modifierExtension = new ArrayList<Extension>();
|
||||
for (Extension i : modifierExtension)
|
||||
dst.modifierExtension.add(i.copy());
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,86 +20,86 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class Base implements Serializable, IBase {
|
||||
|
||||
/**
|
||||
* User appended data items - allow users to add extra information to the class
|
||||
*/
|
||||
private Map<String, Object> userData;
|
||||
|
||||
/**
|
||||
* Round tracking xml comments for testing convenience
|
||||
*/
|
||||
private List<String> formatComments;
|
||||
|
||||
|
||||
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<String, Object>();
|
||||
userData.put(name, value);
|
||||
}
|
||||
|
||||
public boolean hasFormatComment() {
|
||||
return (formatComments != null && !formatComments.isEmpty());
|
||||
}
|
||||
|
||||
public List<String> getFormatComments() {
|
||||
if (formatComments == null)
|
||||
formatComments = new ArrayList<String>();
|
||||
return formatComments;
|
||||
}
|
||||
|
||||
protected abstract void listChildren(List<Property> result) ;
|
||||
|
||||
/**
|
||||
* 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<Property> children() {
|
||||
List<Property> result = new ArrayList<Property>();
|
||||
listChildren(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Property getChildByName(String name) {
|
||||
List<Property> children = new ArrayList<Property>();
|
||||
listChildren(children);
|
||||
for (Property c : children)
|
||||
if (c.getName().equals(name))
|
||||
return c;
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Base> listChildrenByName(String name) {
|
||||
List<Property> children = new ArrayList<Property>();
|
||||
listChildren(children);
|
||||
for (Property c : children)
|
||||
if (c.getName().equals(name) || (c.getName().endsWith("[x]") && name.startsWith(c.getName())))
|
||||
return c.values;
|
||||
return new ArrayList<Base>();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return true; // userData does not count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class Base implements Serializable, IBase {
|
||||
|
||||
/**
|
||||
* User appended data items - allow users to add extra information to the class
|
||||
*/
|
||||
private Map<String, Object> userData;
|
||||
|
||||
/**
|
||||
* Round tracking xml comments for testing convenience
|
||||
*/
|
||||
private List<String> formatComments;
|
||||
|
||||
|
||||
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<String, Object>();
|
||||
userData.put(name, value);
|
||||
}
|
||||
|
||||
public boolean hasFormatComment() {
|
||||
return (formatComments != null && !formatComments.isEmpty());
|
||||
}
|
||||
|
||||
public List<String> getFormatComments() {
|
||||
if (formatComments == null)
|
||||
formatComments = new ArrayList<String>();
|
||||
return formatComments;
|
||||
}
|
||||
|
||||
protected abstract void listChildren(List<Property> result) ;
|
||||
|
||||
/**
|
||||
* 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<Property> children() {
|
||||
List<Property> result = new ArrayList<Property>();
|
||||
listChildren(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Property getChildByName(String name) {
|
||||
List<Property> children = new ArrayList<Property>();
|
||||
listChildren(children);
|
||||
for (Property c : children)
|
||||
if (c.getName().equals(name))
|
||||
return c;
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Base> listChildrenByName(String name) {
|
||||
List<Property> children = new ArrayList<Property>();
|
||||
listChildren(children);
|
||||
for (Property c : children)
|
||||
if (c.getName().equals(name) || (c.getName().endsWith("[x]") && name.startsWith(c.getName())))
|
||||
return c.values;
|
||||
return new ArrayList<Base>();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return true; // userData does not count
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -48,49 +48,49 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
/**
|
||||
* Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64
|
||||
*/
|
||||
public class Base64BinaryType extends PrimitiveType<byte[]> {
|
||||
|
||||
private static final long serialVersionUID = 2L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Base64BinaryType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Base64BinaryType(byte[] theBytes) {
|
||||
setValue(theBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Base64BinaryType(String theValue) {
|
||||
setValueAsString(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected byte[] parse(String theValue) {
|
||||
return Base64.decodeBase64(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(byte[] theValue) {
|
||||
return Base64.encodeBase64String(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Base64BinaryType copy() {
|
||||
return new Base64BinaryType(getValue());
|
||||
}
|
||||
}
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
/**
|
||||
* Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64
|
||||
*/
|
||||
public class Base64BinaryType extends PrimitiveType<byte[]> {
|
||||
|
||||
private static final long serialVersionUID = 2L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Base64BinaryType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Base64BinaryType(byte[] theBytes) {
|
||||
setValue(theBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Base64BinaryType(String theValue) {
|
||||
setValueAsString(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected byte[] parse(String theValue) {
|
||||
return Base64.decodeBase64(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(byte[] theValue) {
|
||||
return Base64.encodeBase64String(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Base64BinaryType copy() {
|
||||
return new Base64BinaryType(getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,335 +20,335 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." )
|
||||
protected List<Identifier> identifier;
|
||||
|
||||
/**
|
||||
* Identifies the 'type' of resource - equivalent to the resource name for other resources.
|
||||
*/
|
||||
@Child(name="code", type={CodeableConcept.class}, order=0, min=1, max=1)
|
||||
@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 resoruce.
|
||||
*/
|
||||
@Child(name="subject", type={}, order=1, min=0, max=1)
|
||||
@Description(shortDefinition="Identifies the", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce." )
|
||||
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 resoruce.)
|
||||
*/
|
||||
protected Resource subjectTarget;
|
||||
|
||||
/**
|
||||
* Indicates who was responsible for creating the resource instance.
|
||||
*/
|
||||
@Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1)
|
||||
@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;
|
||||
|
||||
/**
|
||||
* Identifies when the resource was first created.
|
||||
*/
|
||||
@Child(name="created", type={DateType.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." )
|
||||
protected DateType created;
|
||||
|
||||
private static final long serialVersionUID = 916539354L;
|
||||
|
||||
public Basic() {
|
||||
super();
|
||||
}
|
||||
|
||||
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<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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 resoruce.)
|
||||
*/
|
||||
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();
|
||||
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 resoruce.)
|
||||
*/
|
||||
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 resoruce.)
|
||||
*/
|
||||
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 resoruce.)
|
||||
*/
|
||||
public Basic setSubjectTarget(Resource value) {
|
||||
this.subjectTarget = 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();
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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 resoruce.", 0, java.lang.Integer.MAX_VALUE, subject));
|
||||
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));
|
||||
childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created));
|
||||
}
|
||||
|
||||
public Basic copy() {
|
||||
Basic dst = new Basic();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
for (Identifier i : identifier)
|
||||
dst.identifier.add(i.copy());
|
||||
};
|
||||
dst.code = code == null ? null : code.copy();
|
||||
dst.subject = subject == null ? null : subject.copy();
|
||||
dst.author = author == null ? null : author.copy();
|
||||
dst.created = created == null ? null : created.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Basic typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty())
|
||||
&& (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Basic;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the", type="reference" )
|
||||
public static final String SP_PATIENT = "patient";
|
||||
@SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" )
|
||||
public static final String SP_CREATED = "created";
|
||||
@SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the", type="reference" )
|
||||
public static final String SP_SUBJECT = "subject";
|
||||
@SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" )
|
||||
public static final String SP_CODE = "code";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." )
|
||||
protected List<Identifier> identifier;
|
||||
|
||||
/**
|
||||
* Identifies the 'type' of resource - equivalent to the resource name for other resources.
|
||||
*/
|
||||
@Child(name="code", type={CodeableConcept.class}, order=0, min=1, max=1)
|
||||
@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 resoruce.
|
||||
*/
|
||||
@Child(name="subject", type={}, order=1, min=0, max=1)
|
||||
@Description(shortDefinition="Identifies the", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce." )
|
||||
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 resoruce.)
|
||||
*/
|
||||
protected Resource subjectTarget;
|
||||
|
||||
/**
|
||||
* Indicates who was responsible for creating the resource instance.
|
||||
*/
|
||||
@Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1)
|
||||
@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;
|
||||
|
||||
/**
|
||||
* Identifies when the resource was first created.
|
||||
*/
|
||||
@Child(name="created", type={DateType.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." )
|
||||
protected DateType created;
|
||||
|
||||
private static final long serialVersionUID = 916539354L;
|
||||
|
||||
public Basic() {
|
||||
super();
|
||||
}
|
||||
|
||||
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<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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 resoruce.)
|
||||
*/
|
||||
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();
|
||||
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 resoruce.)
|
||||
*/
|
||||
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 resoruce.)
|
||||
*/
|
||||
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 resoruce.)
|
||||
*/
|
||||
public Basic setSubjectTarget(Resource value) {
|
||||
this.subjectTarget = 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();
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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 resoruce.", 0, java.lang.Integer.MAX_VALUE, subject));
|
||||
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));
|
||||
childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created));
|
||||
}
|
||||
|
||||
public Basic copy() {
|
||||
Basic dst = new Basic();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
for (Identifier i : identifier)
|
||||
dst.identifier.add(i.copy());
|
||||
};
|
||||
dst.code = code == null ? null : code.copy();
|
||||
dst.subject = subject == null ? null : subject.copy();
|
||||
dst.author = author == null ? null : author.copy();
|
||||
dst.created = created == null ? null : created.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Basic typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty())
|
||||
&& (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Basic;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the", type="reference" )
|
||||
public static final String SP_PATIENT = "patient";
|
||||
@SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" )
|
||||
public static final String SP_CREATED = "created";
|
||||
@SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the", type="reference" )
|
||||
public static final String SP_SUBJECT = "subject";
|
||||
@SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" )
|
||||
public static final String SP_CODE = "code";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,198 +20,198 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* 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 Resource {
|
||||
|
||||
/**
|
||||
* MimeType of the binary content represented as a standard MimeType (BCP 13).
|
||||
*/
|
||||
@Child(name="contentType", type={CodeType.class}, order=-1, min=1, max=1)
|
||||
@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=0, min=1, max=1)
|
||||
@Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." )
|
||||
protected Base64BinaryType content;
|
||||
|
||||
private static final long serialVersionUID = 974764407L;
|
||||
|
||||
public Binary() {
|
||||
super();
|
||||
}
|
||||
|
||||
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();
|
||||
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();
|
||||
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<Property> 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));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Binary;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" )
|
||||
public static final String SP_CONTENTTYPE = "contenttype";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* 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 Resource {
|
||||
|
||||
/**
|
||||
* MimeType of the binary content represented as a standard MimeType (BCP 13).
|
||||
*/
|
||||
@Child(name="contentType", type={CodeType.class}, order=-1, min=1, max=1)
|
||||
@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=0, min=1, max=1)
|
||||
@Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." )
|
||||
protected Base64BinaryType content;
|
||||
|
||||
private static final long serialVersionUID = 974764407L;
|
||||
|
||||
public Binary() {
|
||||
super();
|
||||
}
|
||||
|
||||
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();
|
||||
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();
|
||||
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<Property> 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));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.Binary;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" )
|
||||
public static final String SP_CONTENTTYPE = "contenttype";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -51,62 +51,62 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
/**
|
||||
* Primitive type "boolean" in FHIR "true" or "false"
|
||||
*/
|
||||
@DatatypeDef(name="boolean")
|
||||
public class BooleanType extends PrimitiveType<Boolean> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BooleanType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BooleanType(boolean theBoolean) {
|
||||
setValue(theBoolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BooleanType(Boolean theBoolean) {
|
||||
setValue(theBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
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 + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(Boolean theValue) {
|
||||
if (Boolean.TRUE.equals(theValue)) {
|
||||
return "true";
|
||||
} else {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanType copy() {
|
||||
return new BooleanType(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
/**
|
||||
* Primitive type "boolean" in FHIR "true" or "false"
|
||||
*/
|
||||
@DatatypeDef(name="boolean")
|
||||
public class BooleanType extends PrimitiveType<Boolean> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BooleanType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BooleanType(boolean theBoolean) {
|
||||
setValue(theBoolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BooleanType(Boolean theBoolean) {
|
||||
setValue(theBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
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 + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(Boolean theValue) {
|
||||
if (Boolean.TRUE.equals(theValue)) {
|
||||
return "true";
|
||||
} else {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanType copy() {
|
||||
return new BooleanType(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,31 +1,31 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -48,54 +48,54 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
|
||||
/**
|
||||
* Primitive type "code" in FHIR, when not bound to an enumerated list of codes
|
||||
*/
|
||||
@DatatypeDef(name = "code")
|
||||
public class CodeType extends PrimitiveType<String> implements Comparable<CodeType> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public CodeType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which accepts a string code
|
||||
*/
|
||||
public CodeType(String theCode) {
|
||||
setValue(theCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
|
||||
/**
|
||||
* Primitive type "code" in FHIR, when not bound to an enumerated list of codes
|
||||
*/
|
||||
@DatatypeDef(name = "code")
|
||||
public class CodeType extends PrimitiveType<String> implements Comparable<CodeType> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public CodeType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which accepts a string code
|
||||
*/
|
||||
public CodeType(String theCode) {
|
||||
setValue(theCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,176 +20,176 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." )
|
||||
protected List<Coding> 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=0, min=0, max=1)
|
||||
@Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." )
|
||||
protected StringType text;
|
||||
|
||||
private static final long serialVersionUID = 760353246L;
|
||||
|
||||
public CodeableConcept() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #coding} (A reference to a code defined by a terminology system.)
|
||||
*/
|
||||
public List<Coding> getCoding() {
|
||||
if (this.coding == null)
|
||||
this.coding = new ArrayList<Coding>();
|
||||
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<Coding>();
|
||||
this.coding.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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<Property> 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));
|
||||
}
|
||||
|
||||
public CodeableConcept copy() {
|
||||
CodeableConcept dst = new CodeableConcept();
|
||||
copyValues(dst);
|
||||
if (coding != null) {
|
||||
dst.coding = new ArrayList<Coding>();
|
||||
for (Coding i : coding)
|
||||
dst.coding.add(i.copy());
|
||||
};
|
||||
dst.text = text == null ? null : text.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected CodeableConcept typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." )
|
||||
protected List<Coding> 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=0, min=0, max=1)
|
||||
@Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." )
|
||||
protected StringType text;
|
||||
|
||||
private static final long serialVersionUID = 760353246L;
|
||||
|
||||
public CodeableConcept() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #coding} (A reference to a code defined by a terminology system.)
|
||||
*/
|
||||
public List<Coding> getCoding() {
|
||||
if (this.coding == null)
|
||||
this.coding = new ArrayList<Coding>();
|
||||
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<Coding>();
|
||||
this.coding.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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<Property> 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));
|
||||
}
|
||||
|
||||
public CodeableConcept copy() {
|
||||
CodeableConcept dst = new CodeableConcept();
|
||||
copyValues(dst);
|
||||
if (coding != null) {
|
||||
dst.coding = new ArrayList<Coding>();
|
||||
for (Coding i : coding)
|
||||
dst.coding.add(i.copy());
|
||||
};
|
||||
dst.text = text == null ? null : text.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected CodeableConcept typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,424 +20,424 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* A reference to a code defined by a terminology system.
|
||||
*/
|
||||
@DatatypeDef(name="Coding")
|
||||
public class Coding extends Type implements ICompositeType{
|
||||
|
||||
/**
|
||||
* The identification of the code system that defines the meaning of the symbol in the code.
|
||||
*/
|
||||
@Child(name="system", type={UriType.class}, order=-1, min=0, max=1)
|
||||
@Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." )
|
||||
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=0, min=0, max=1)
|
||||
@Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." )
|
||||
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=1, min=0, max=1)
|
||||
@Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." )
|
||||
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=2, min=0, max=1)
|
||||
@Description(shortDefinition="Representation defined by the system", formalDefinition="A representation of the meaning of the code in the system, following the rules of the system." )
|
||||
protected StringType display;
|
||||
|
||||
/**
|
||||
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
|
||||
*/
|
||||
@Child(name="primary", type={BooleanType.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="If this code was chosen directly by the user", formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." )
|
||||
protected BooleanType primary;
|
||||
|
||||
/**
|
||||
* The set of possible coded values this coding was chosen from or constrained by.
|
||||
*/
|
||||
@Child(name="valueSet", type={ValueSet.class}, order=4, min=0, max=1)
|
||||
@Description(shortDefinition="Set this coding was chosen from", formalDefinition="The set of possible coded values this coding was chosen from or constrained by." )
|
||||
protected Reference valueSet;
|
||||
|
||||
/**
|
||||
* The actual object that is the target of the reference (The set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
protected ValueSet valueSetTarget;
|
||||
|
||||
private static final long serialVersionUID = -1529268796L;
|
||||
|
||||
public Coding() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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 #primary} (Indicates that this code 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 "getPrimary" gives direct access to the value
|
||||
*/
|
||||
public BooleanType getPrimaryElement() {
|
||||
if (this.primary == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Coding.primary");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.primary = new BooleanType();
|
||||
return this.primary;
|
||||
}
|
||||
|
||||
public boolean hasPrimaryElement() {
|
||||
return this.primary != null && !this.primary.isEmpty();
|
||||
}
|
||||
|
||||
public boolean hasPrimary() {
|
||||
return this.primary != null && !this.primary.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #primary} (Indicates that this code 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 "getPrimary" gives direct access to the value
|
||||
*/
|
||||
public Coding setPrimaryElement(BooleanType value) {
|
||||
this.primary = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
|
||||
*/
|
||||
public boolean getPrimary() {
|
||||
return this.primary == null ? false : this.primary.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
|
||||
*/
|
||||
public Coding setPrimary(boolean value) {
|
||||
if (value == false)
|
||||
this.primary = null;
|
||||
else {
|
||||
if (this.primary == null)
|
||||
this.primary = new BooleanType();
|
||||
this.primary.setValue(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public Reference getValueSet() {
|
||||
if (this.valueSet == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Coding.valueSet");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.valueSet = new Reference();
|
||||
return this.valueSet;
|
||||
}
|
||||
|
||||
public boolean hasValueSet() {
|
||||
return this.valueSet != null && !this.valueSet.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public Coding setValueSet(Reference value) {
|
||||
this.valueSet = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #valueSet} The actual object that is the 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 set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public ValueSet getValueSetTarget() {
|
||||
if (this.valueSetTarget == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Coding.valueSet");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.valueSetTarget = new ValueSet();
|
||||
return this.valueSetTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #valueSet} The actual object that is the 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 set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public Coding setValueSetTarget(ValueSet value) {
|
||||
this.valueSetTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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("primary", "boolean", "Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).", 0, java.lang.Integer.MAX_VALUE, primary));
|
||||
childrenList.add(new Property("valueSet", "Reference(ValueSet)", "The set of possible coded values this coding was chosen from or constrained by.", 0, java.lang.Integer.MAX_VALUE, valueSet));
|
||||
}
|
||||
|
||||
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.primary = primary == null ? null : primary.copy();
|
||||
dst.valueSet = valueSet == null ? null : valueSet.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Coding typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty())
|
||||
&& (code == null || code.isEmpty()) && (display == null || display.isEmpty()) && (primary == null || primary.isEmpty())
|
||||
&& (valueSet == null || valueSet.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* A reference to a code defined by a terminology system.
|
||||
*/
|
||||
@DatatypeDef(name="Coding")
|
||||
public class Coding extends Type implements ICompositeType{
|
||||
|
||||
/**
|
||||
* The identification of the code system that defines the meaning of the symbol in the code.
|
||||
*/
|
||||
@Child(name="system", type={UriType.class}, order=-1, min=0, max=1)
|
||||
@Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." )
|
||||
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=0, min=0, max=1)
|
||||
@Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." )
|
||||
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=1, min=0, max=1)
|
||||
@Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." )
|
||||
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=2, min=0, max=1)
|
||||
@Description(shortDefinition="Representation defined by the system", formalDefinition="A representation of the meaning of the code in the system, following the rules of the system." )
|
||||
protected StringType display;
|
||||
|
||||
/**
|
||||
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
|
||||
*/
|
||||
@Child(name="primary", type={BooleanType.class}, order=3, min=0, max=1)
|
||||
@Description(shortDefinition="If this code was chosen directly by the user", formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." )
|
||||
protected BooleanType primary;
|
||||
|
||||
/**
|
||||
* The set of possible coded values this coding was chosen from or constrained by.
|
||||
*/
|
||||
@Child(name="valueSet", type={ValueSet.class}, order=4, min=0, max=1)
|
||||
@Description(shortDefinition="Set this coding was chosen from", formalDefinition="The set of possible coded values this coding was chosen from or constrained by." )
|
||||
protected Reference valueSet;
|
||||
|
||||
/**
|
||||
* The actual object that is the target of the reference (The set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
protected ValueSet valueSetTarget;
|
||||
|
||||
private static final long serialVersionUID = -1529268796L;
|
||||
|
||||
public Coding() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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();
|
||||
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();
|
||||
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();
|
||||
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 #primary} (Indicates that this code 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 "getPrimary" gives direct access to the value
|
||||
*/
|
||||
public BooleanType getPrimaryElement() {
|
||||
if (this.primary == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Coding.primary");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.primary = new BooleanType();
|
||||
return this.primary;
|
||||
}
|
||||
|
||||
public boolean hasPrimaryElement() {
|
||||
return this.primary != null && !this.primary.isEmpty();
|
||||
}
|
||||
|
||||
public boolean hasPrimary() {
|
||||
return this.primary != null && !this.primary.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #primary} (Indicates that this code 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 "getPrimary" gives direct access to the value
|
||||
*/
|
||||
public Coding setPrimaryElement(BooleanType value) {
|
||||
this.primary = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
|
||||
*/
|
||||
public boolean getPrimary() {
|
||||
return this.primary == null ? false : this.primary.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
|
||||
*/
|
||||
public Coding setPrimary(boolean value) {
|
||||
if (value == false)
|
||||
this.primary = null;
|
||||
else {
|
||||
if (this.primary == null)
|
||||
this.primary = new BooleanType();
|
||||
this.primary.setValue(value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public Reference getValueSet() {
|
||||
if (this.valueSet == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Coding.valueSet");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.valueSet = new Reference();
|
||||
return this.valueSet;
|
||||
}
|
||||
|
||||
public boolean hasValueSet() {
|
||||
return this.valueSet != null && !this.valueSet.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public Coding setValueSet(Reference value) {
|
||||
this.valueSet = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #valueSet} The actual object that is the 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 set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public ValueSet getValueSetTarget() {
|
||||
if (this.valueSetTarget == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create Coding.valueSet");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.valueSetTarget = new ValueSet();
|
||||
return this.valueSetTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value {@link #valueSet} The actual object that is the 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 set of possible coded values this coding was chosen from or constrained by.)
|
||||
*/
|
||||
public Coding setValueSetTarget(ValueSet value) {
|
||||
this.valueSetTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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("primary", "boolean", "Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).", 0, java.lang.Integer.MAX_VALUE, primary));
|
||||
childrenList.add(new Property("valueSet", "Reference(ValueSet)", "The set of possible coded values this coding was chosen from or constrained by.", 0, java.lang.Integer.MAX_VALUE, valueSet));
|
||||
}
|
||||
|
||||
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.primary = primary == null ? null : primary.copy();
|
||||
dst.valueSet = valueSet == null ? null : valueSet.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Coding typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty())
|
||||
&& (code == null || code.isEmpty()) && (display == null || display.isEmpty()) && (primary == null || primary.isEmpty())
|
||||
&& (valueSet == null || valueSet.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,110 +20,110 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 <T extends Enum<?>> boolean matches(Enumeration<T> e1, Enumeration<T> 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 Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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<Coding> list, Coding c, MatchProfile profile) throws Exception {
|
||||
for (Coding item : list) {
|
||||
if (matches(item, c, profile))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean matches(Coding c1, Coding c2, MatchProfile profile) throws Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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) throws Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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.getLabelElement() == null && src.getLabelElement() != null)
|
||||
dst.setLabelElement(src.getLabelElement());
|
||||
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) throws Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 <T extends Enum<?>> boolean matches(Enumeration<T> e1, Enumeration<T> 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 Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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<Coding> list, Coding c, MatchProfile profile) throws Exception {
|
||||
for (Coding item : list) {
|
||||
if (matches(item, c, profile))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean matches(Coding c1, Coding c2, MatchProfile profile) throws Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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) throws Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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.getLabelElement() == null && src.getLabelElement() != null)
|
||||
dst.setLabelElement(src.getLabelElement());
|
||||
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) throws Exception {
|
||||
if (profile != null)
|
||||
throw new Exception("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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,108 +20,108 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,42 +20,42 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
|
||||
public class Constants {
|
||||
|
||||
public final static String VERSION = "0.3.0";
|
||||
public final static String REVISION = "3775";
|
||||
public final static String DATE = "Sun Dec 07 21:45:56 EST 2014";
|
||||
}
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
|
||||
public class Constants {
|
||||
|
||||
public final static String VERSION = "0.3.0";
|
||||
public final static String REVISION = "3775";
|
||||
public final static String DATE = "Sun Dec 07 21:45:56 EST 2014";
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Count extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Count copy() {
|
||||
Count dst = new Count();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Count typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Count extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Count copy() {
|
||||
Count dst = new Count();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Count typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,32 +1,32 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -49,165 +49,165 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
|
||||
/**
|
||||
* Represents a FHIR dateTime datatype. Valid precisions values for this type are:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link TemporalPrecisionEnum#DAY}
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
@DatatypeDef(name = "dateTime")
|
||||
public class DateTimeType extends BaseDateTimeType {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link TemporalPrecisionEnum#DAY}
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*
|
||||
* @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:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link TemporalPrecisionEnum#DAY}
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
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 InstantType parseV3(String theV3String) {
|
||||
InstantType retVal = new InstantType();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
|
||||
/**
|
||||
* Represents a FHIR dateTime datatype. Valid precisions values for this type are:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link TemporalPrecisionEnum#DAY}
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
@DatatypeDef(name = "dateTime")
|
||||
public class DateTimeType extends BaseDateTimeType {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link TemporalPrecisionEnum#DAY}
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*
|
||||
* @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:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link TemporalPrecisionEnum#DAY}
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
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 InstantType parseV3(String theV3String) {
|
||||
InstantType retVal = new InstantType();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -49,96 +49,96 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Primitive type "date" in FHIR: any day in a gregorian calendar
|
||||
*/
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Represents a FHIR date datatype. Valid precisions values for this type are:
|
||||
* <ul>
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY}
|
||||
* </ul>
|
||||
*/
|
||||
@DatatypeDef(name = "date")
|
||||
public class DateType extends BaseDateTimeType {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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:
|
||||
* <ul>
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY}
|
||||
* </ul>
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
@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(getValue());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Primitive type "date" in FHIR: any day in a gregorian calendar
|
||||
*/
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Represents a FHIR date datatype. Valid precisions values for this type are:
|
||||
* <ul>
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY}
|
||||
* </ul>
|
||||
*/
|
||||
@DatatypeDef(name = "date")
|
||||
public class DateType extends BaseDateTimeType {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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:
|
||||
* <ul>
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH}
|
||||
* <li>{@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY}
|
||||
* </ul>
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
@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(getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -51,128 +51,128 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
/**
|
||||
* Primitive type "decimal" in FHIR: A rational number
|
||||
*/
|
||||
@DatatypeDef(name = "decimal")
|
||||
public class DecimalType extends PrimitiveType<BigDecimal> implements Comparable<DecimalType> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecimalType copy() {
|
||||
return new DecimalType(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
/**
|
||||
* Primitive type "decimal" in FHIR: A rational number
|
||||
*/
|
||||
@DatatypeDef(name = "decimal")
|
||||
public class DecimalType extends PrimitiveType<BigDecimal> implements Comparable<DecimalType> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecimalType copy() {
|
||||
return new DecimalType(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Distance extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Distance copy() {
|
||||
Distance dst = new Distance();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Distance typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Distance extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Distance copy() {
|
||||
Distance dst = new Distance();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Distance typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,224 +20,224 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ResourceDef(name="DomainResource", profile="http://hl7.org/fhir/Profile/DomainResource")
|
||||
public abstract class DomainResource extends Resource {
|
||||
|
||||
/**
|
||||
* 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=-1, min=0, max=1)
|
||||
@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=0, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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<Resource> 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=1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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> 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=2, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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<Extension> modifierExtension;
|
||||
|
||||
private static final long serialVersionUID = -970285559L;
|
||||
|
||||
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();
|
||||
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<Resource> getContained() {
|
||||
if (this.contained == null)
|
||||
this.contained = new ArrayList<Resource>();
|
||||
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.)
|
||||
*/
|
||||
/**
|
||||
* @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<Extension> getExtension() {
|
||||
if (this.extension == null)
|
||||
this.extension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.extension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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<Extension> getModifierExtension() {
|
||||
if (this.modifierExtension == null)
|
||||
this.modifierExtension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.modifierExtension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public abstract DomainResource copy();
|
||||
|
||||
public void copyValues(DomainResource dst) {
|
||||
dst.text = text == null ? null : text.copy();
|
||||
if (contained != null) {
|
||||
dst.contained = new ArrayList<Resource>();
|
||||
for (Resource i : contained)
|
||||
dst.contained.add(i.copy());
|
||||
};
|
||||
if (extension != null) {
|
||||
dst.extension = new ArrayList<Extension>();
|
||||
for (Extension i : extension)
|
||||
dst.extension.add(i.copy());
|
||||
};
|
||||
if (modifierExtension != null) {
|
||||
dst.modifierExtension = new ArrayList<Extension>();
|
||||
for (Extension i : modifierExtension)
|
||||
dst.modifierExtension.add(i.copy());
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty())
|
||||
&& (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ResourceDef(name="DomainResource", profile="http://hl7.org/fhir/Profile/DomainResource")
|
||||
public abstract class DomainResource extends Resource {
|
||||
|
||||
/**
|
||||
* 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=-1, min=0, max=1)
|
||||
@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=0, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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<Resource> 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=1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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> 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=2, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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<Extension> modifierExtension;
|
||||
|
||||
private static final long serialVersionUID = -970285559L;
|
||||
|
||||
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();
|
||||
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<Resource> getContained() {
|
||||
if (this.contained == null)
|
||||
this.contained = new ArrayList<Resource>();
|
||||
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.)
|
||||
*/
|
||||
/**
|
||||
* @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<Extension> getExtension() {
|
||||
if (this.extension == null)
|
||||
this.extension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.extension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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<Extension> getModifierExtension() {
|
||||
if (this.modifierExtension == null)
|
||||
this.modifierExtension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.modifierExtension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public abstract DomainResource copy();
|
||||
|
||||
public void copyValues(DomainResource dst) {
|
||||
dst.text = text == null ? null : text.copy();
|
||||
if (contained != null) {
|
||||
dst.contained = new ArrayList<Resource>();
|
||||
for (Resource i : contained)
|
||||
dst.contained.add(i.copy());
|
||||
};
|
||||
if (extension != null) {
|
||||
dst.extension = new ArrayList<Extension>();
|
||||
for (Extension i : extension)
|
||||
dst.extension.add(i.copy());
|
||||
};
|
||||
if (modifierExtension != null) {
|
||||
dst.modifierExtension = new ArrayList<Extension>();
|
||||
for (Extension i : modifierExtension)
|
||||
dst.modifierExtension.add(i.copy());
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty())
|
||||
&& (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Duration extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Duration copy() {
|
||||
Duration dst = new Duration();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Duration typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Duration extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Duration copy() {
|
||||
Duration dst = new Duration();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Duration typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,169 +20,169 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* Base definition for all elements in a resource.
|
||||
*/
|
||||
public abstract class Element extends Base {
|
||||
|
||||
/**
|
||||
* unique id for the element within a resource (for internal references).
|
||||
*/
|
||||
@Child(name="id", type={IdType.class}, order=-1, min=0, max=1)
|
||||
@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=0, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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> extension;
|
||||
|
||||
private static final long serialVersionUID = -158027598L;
|
||||
|
||||
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();
|
||||
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<Extension> getExtension() {
|
||||
if (this.extension == null)
|
||||
this.extension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.extension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public abstract Element copy();
|
||||
|
||||
public void copyValues(Element dst) {
|
||||
dst.id = id == null ? null : id.copy();
|
||||
if (extension != null) {
|
||||
dst.extension = new ArrayList<Extension>();
|
||||
for (Extension i : extension)
|
||||
dst.extension.add(i.copy());
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* Base definition for all elements in a resource.
|
||||
*/
|
||||
public abstract class Element extends Base {
|
||||
|
||||
/**
|
||||
* unique id for the element within a resource (for internal references).
|
||||
*/
|
||||
@Child(name="id", type={IdType.class}, order=-1, min=0, max=1)
|
||||
@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=0, min=0, max=Child.MAX_UNLIMITED)
|
||||
@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> extension;
|
||||
|
||||
private static final long serialVersionUID = -158027598L;
|
||||
|
||||
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();
|
||||
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<Extension> getExtension() {
|
||||
if (this.extension == null)
|
||||
this.extension = new ArrayList<Extension>();
|
||||
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<Extension>();
|
||||
this.extension.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public abstract Element copy();
|
||||
|
||||
public void copyValues(Element dst) {
|
||||
dst.id = id == null ? null : id.copy();
|
||||
if (extension != null) {
|
||||
dst.extension = new ArrayList<Extension>();
|
||||
for (Extension i : extension)
|
||||
dst.extension.add(i.copy());
|
||||
};
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,426 +20,426 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." )
|
||||
protected List<Identifier> 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=0, min=0, max=1)
|
||||
@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=1, min=0, max=1)
|
||||
@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=2, min=0, max=1)
|
||||
@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=3, min=0, max=1)
|
||||
@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=4, min=0, max=1)
|
||||
@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=5, min=0, max=1)
|
||||
@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;
|
||||
|
||||
private static final long serialVersionUID = 1836339504L;
|
||||
|
||||
public EligibilityRequest() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #identifier} (The Response Business Identifier.)
|
||||
*/
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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();
|
||||
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();
|
||||
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 Reference getTarget() {
|
||||
if (this.target == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create EligibilityRequest.target");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.target = new Reference();
|
||||
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 EligibilityRequest 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 EligibilityRequest.target");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.targetTarget = new Organization();
|
||||
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 EligibilityRequest 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 EligibilityRequest.provider");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.provider = new Reference();
|
||||
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 EligibilityRequest 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 EligibilityRequest.provider");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.providerTarget = new Practitioner();
|
||||
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 EligibilityRequest 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 EligibilityRequest.organization");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.organization = new Reference();
|
||||
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 EligibilityRequest 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 EligibilityRequest.organization");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.organizationTarget = new Organization();
|
||||
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 EligibilityRequest setOrganizationTarget(Organization value) {
|
||||
this.organizationTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public EligibilityRequest copy() {
|
||||
EligibilityRequest dst = new EligibilityRequest();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
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();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected EligibilityRequest typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
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())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.EligibilityRequest;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" )
|
||||
public static final String SP_IDENTIFIER = "identifier";
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.ResourceDef;
|
||||
import org.hl7.fhir.instance.model.annotations.SearchParamDefinition;
|
||||
import org.hl7.fhir.instance.model.annotations.Block;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
/**
|
||||
* 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=-1, min=0, max=Child.MAX_UNLIMITED)
|
||||
@Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." )
|
||||
protected List<Identifier> 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=0, min=0, max=1)
|
||||
@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=1, min=0, max=1)
|
||||
@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=2, min=0, max=1)
|
||||
@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=3, min=0, max=1)
|
||||
@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=4, min=0, max=1)
|
||||
@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=5, min=0, max=1)
|
||||
@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;
|
||||
|
||||
private static final long serialVersionUID = 1836339504L;
|
||||
|
||||
public EligibilityRequest() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link #identifier} (The Response Business Identifier.)
|
||||
*/
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (this.identifier == null)
|
||||
this.identifier = new ArrayList<Identifier>();
|
||||
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<Identifier>();
|
||||
this.identifier.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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();
|
||||
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();
|
||||
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 Reference getTarget() {
|
||||
if (this.target == null)
|
||||
if (Configuration.errorOnAutoCreate())
|
||||
throw new Error("Attempt to auto-create EligibilityRequest.target");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.target = new Reference();
|
||||
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 EligibilityRequest 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 EligibilityRequest.target");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.targetTarget = new Organization();
|
||||
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 EligibilityRequest 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 EligibilityRequest.provider");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.provider = new Reference();
|
||||
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 EligibilityRequest 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 EligibilityRequest.provider");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.providerTarget = new Practitioner();
|
||||
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 EligibilityRequest 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 EligibilityRequest.organization");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.organization = new Reference();
|
||||
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 EligibilityRequest 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 EligibilityRequest.organization");
|
||||
else if (Configuration.doAutoCreate())
|
||||
this.organizationTarget = new Organization();
|
||||
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 EligibilityRequest setOrganizationTarget(Organization value) {
|
||||
this.organizationTarget = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
public EligibilityRequest copy() {
|
||||
EligibilityRequest dst = new EligibilityRequest();
|
||||
copyValues(dst);
|
||||
if (identifier != null) {
|
||||
dst.identifier = new ArrayList<Identifier>();
|
||||
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();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected EligibilityRequest typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
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())
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceType getResourceType() {
|
||||
return ResourceType.EligibilityRequest;
|
||||
}
|
||||
|
||||
@SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" )
|
||||
public static final String SP_IDENTIFIER = "identifier";
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,56 +20,56 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
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<T extends Enum<?>> {
|
||||
|
||||
/**
|
||||
* 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 IllegalArgumentException 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
|
||||
* @throws IllegalArgumentException if the enumeration is not valid (would usually indicate a code generation bug)
|
||||
*/
|
||||
public String toCode(T code) throws IllegalArgumentException;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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<T extends Enum<?>> {
|
||||
|
||||
/**
|
||||
* 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 IllegalArgumentException 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
|
||||
* @throws IllegalArgumentException if the enumeration is not valid (would usually indicate a code generation bug)
|
||||
*/
|
||||
public String toCode(T code) throws IllegalArgumentException;
|
||||
|
||||
}
|
||||
|
|
|
@ -20,106 +20,106 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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
|
||||
*
|
||||
*/
|
||||
public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private EnumFactory<T> myEnumFactory;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(T theValue) {
|
||||
setValue(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(String theValue) {
|
||||
setValueAsString(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(EnumFactory<T> theEnumFactory, T theValue) {
|
||||
myEnumFactory = theEnumFactory;
|
||||
setValue(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(EnumFactory<T> theEnumFactory, String theValue) {
|
||||
myEnumFactory = theEnumFactory;
|
||||
setValueAsString(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(EnumFactory<T> theEnumFactory) {
|
||||
myEnumFactory = theEnumFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
protected T parse(String theValue) {
|
||||
if (myEnumFactory != null) {
|
||||
return myEnumFactory.fromCode(theValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(T theValue) {
|
||||
return ((FhirEnum)theValue).toCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
return new Enumeration<T>(myEnumFactory, getValue());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
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
|
||||
*
|
||||
*/
|
||||
public class Enumeration<T extends Enum<?>> extends PrimitiveType<T> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private EnumFactory<T> myEnumFactory;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(T theValue) {
|
||||
setValue(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(String theValue) {
|
||||
setValueAsString(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(EnumFactory<T> theEnumFactory, T theValue) {
|
||||
myEnumFactory = theEnumFactory;
|
||||
setValue(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(EnumFactory<T> theEnumFactory, String theValue) {
|
||||
myEnumFactory = theEnumFactory;
|
||||
setValueAsString(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration(EnumFactory<T> theEnumFactory) {
|
||||
myEnumFactory = theEnumFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Enumeration() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
protected T parse(String theValue) {
|
||||
if (myEnumFactory != null) {
|
||||
return myEnumFactory.fromCode(theValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(T theValue) {
|
||||
return ((FhirEnum)theValue).toCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<T> copy() {
|
||||
return new Enumeration<T>(myEnumFactory, getValue());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,162 +20,162 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* Optional Extensions Element - found in all resources.
|
||||
*/
|
||||
@DatatypeDef(name="Extension")
|
||||
public class Extension extends Element {
|
||||
|
||||
/**
|
||||
* Source of the definition for the extension code - a logical name or a URL.
|
||||
*/
|
||||
@Child(name="url", type={UriType.class}, order=-1, min=1, max=1)
|
||||
@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=0, min=0, max=1)
|
||||
@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.instance.model.Type value;
|
||||
|
||||
private static final long serialVersionUID = 86382982L;
|
||||
|
||||
public Extension() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Extension(UriType url) {
|
||||
super();
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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.instance.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.instance.model.Type value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* Optional Extensions Element - found in all resources.
|
||||
*/
|
||||
@DatatypeDef(name="Extension")
|
||||
public class Extension extends Element {
|
||||
|
||||
/**
|
||||
* Source of the definition for the extension code - a logical name or a URL.
|
||||
*/
|
||||
@Child(name="url", type={UriType.class}, order=-1, min=1, max=1)
|
||||
@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=0, min=0, max=1)
|
||||
@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.instance.model.Type value;
|
||||
|
||||
private static final long serialVersionUID = 86382982L;
|
||||
|
||||
public Extension() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Extension(UriType url) {
|
||||
super();
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
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.instance.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.instance.model.Type value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void listChildren(List<Property> 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));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,148 +20,148 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 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 Exception {
|
||||
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 Exception("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 Exception("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 Exception("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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 Exception {
|
||||
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 Exception("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 Exception("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 Exception("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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,47 +20,47 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface to be implemented by all built-in FHIR enumerations (i.e. the
|
||||
* actual FHIR-defined Java Enum will implement this interface)
|
||||
*/
|
||||
public interface FhirEnum {
|
||||
|
||||
/**
|
||||
* Get the XML/JSON representation for an enumerated value
|
||||
* @return the XML/JSON representation
|
||||
*/
|
||||
public String toCode();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface to be implemented by all built-in FHIR enumerations (i.e. the
|
||||
* actual FHIR-defined Java Enum will implement this interface)
|
||||
*/
|
||||
public interface FhirEnum {
|
||||
|
||||
/**
|
||||
* Get the XML/JSON representation for an enumerated value
|
||||
* @return the XML/JSON representation
|
||||
*/
|
||||
public String toCode();
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,31 +1,31 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -48,43 +48,43 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "."
|
||||
*/
|
||||
public class IdType extends PrimitiveType<String> {
|
||||
|
||||
public static final int MAX_LENGTH = 64;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public IdType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public IdType(String theValue) {
|
||||
setValue(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parse(String theValue) {
|
||||
return theValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(String theValue) {
|
||||
return theValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdType copy() {
|
||||
return new IdType(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "."
|
||||
*/
|
||||
public class IdType extends PrimitiveType<String> {
|
||||
|
||||
public static final int MAX_LENGTH = 64;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public IdType() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public IdType(String theValue) {
|
||||
setValue(theValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parse(String theValue) {
|
||||
return theValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String encode(String theValue) {
|
||||
return theValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdType copy() {
|
||||
return new IdType(getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,34 +1,34 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -51,188 +51,188 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
/**
|
||||
* Represents a FHIR instant datatype. Valid precisions values for this type are:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
public class InstantType extends BaseDateTimeType {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The default precision for this type
|
||||
*/
|
||||
public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI;
|
||||
|
||||
/**
|
||||
* Constructor which creates an InstantDt with <b>no timne value</b>. 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 ca.uhn.fhir.parser.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. <b>Use this constructor with caution</b>,
|
||||
* 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:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
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 ca.uhn.fhir.parser.DataFormatException If the value is invalid
|
||||
*/
|
||||
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(getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
/**
|
||||
* Represents a FHIR instant datatype. Valid precisions values for this type are:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
public class InstantType extends BaseDateTimeType {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The default precision for this type
|
||||
*/
|
||||
public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI;
|
||||
|
||||
/**
|
||||
* Constructor which creates an InstantDt with <b>no timne value</b>. 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 ca.uhn.fhir.parser.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. <b>Use this constructor with caution</b>,
|
||||
* 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:
|
||||
* <ul>
|
||||
* <li>{@link TemporalPrecisionEnum#SECOND}
|
||||
* <li>{@link TemporalPrecisionEnum#MILLI}
|
||||
* </ul>
|
||||
*/
|
||||
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 ca.uhn.fhir.parser.DataFormatException If the value is invalid
|
||||
*/
|
||||
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(getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,34 +1,34 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/*
|
||||
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.instance.model;
|
||||
|
||||
/*
|
||||
|
@ -51,76 +51,76 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
/**
|
||||
* Primitive type "integer" in FHIR: A signed 32-bit integer
|
||||
*/
|
||||
@DatatypeDef(name = "integer")
|
||||
public class IntegerType extends PrimitiveType<Integer> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
|
||||
/**
|
||||
* Primitive type "integer" in FHIR: A signed 32-bit integer
|
||||
*/
|
||||
@DatatypeDef(name = "integer")
|
||||
public class IntegerType extends PrimitiveType<Integer> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Money extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Money copy() {
|
||||
Money dst = new Money();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Money typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import org.hl7.fhir.instance.model.annotations.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")
|
||||
public class Money extends Quantity {
|
||||
|
||||
private static final long serialVersionUID = -483422721L;
|
||||
|
||||
public Money copy() {
|
||||
Money dst = new Money();
|
||||
copyValues(dst);
|
||||
dst.value = value == null ? null : value.copy();
|
||||
dst.comparator = comparator == null ? null : comparator.copy();
|
||||
dst.units = units == null ? null : units.copy();
|
||||
dst.system = system == null ? null : system.copy();
|
||||
dst.code = code == null ? null : code.copy();
|
||||
return dst;
|
||||
}
|
||||
|
||||
protected Money typedCopy() {
|
||||
return copy();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
|
||||
&& (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,272 +20,272 @@ package org.hl7.fhir.instance.model;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* A human-readable formatted text, including images.
|
||||
*/
|
||||
@DatatypeDef(name="Narrative")
|
||||
public class Narrative extends Element {
|
||||
|
||||
public enum NarrativeStatus implements FhirEnum {
|
||||
/**
|
||||
* The contents of the narrative are entirely generated from the structured data in the resource.
|
||||
*/
|
||||
GENERATED,
|
||||
/**
|
||||
* The contents of the narrative are entirely generated from the structured data in the resource 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 for this resource".
|
||||
*/
|
||||
EMPTY,
|
||||
/**
|
||||
* added to help the parsers
|
||||
*/
|
||||
NULL;
|
||||
|
||||
public static final NarrativeStatusEnumFactory ENUM_FACTORY = new NarrativeStatusEnumFactory();
|
||||
|
||||
public static NarrativeStatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
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 IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'");
|
||||
}
|
||||
@Override
|
||||
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 "";
|
||||
case EXTENSIONS: return "";
|
||||
case ADDITIONAL: return "";
|
||||
case EMPTY: return "";
|
||||
default: return "?";
|
||||
}
|
||||
}
|
||||
public String getDefinition() {
|
||||
switch (this) {
|
||||
case GENERATED: return "The contents of the narrative are entirely generated from the structured data in the resource.";
|
||||
case EXTENSIONS: return "The contents of the narrative are entirely generated from the structured data in the resource 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 for this resource'.";
|
||||
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<NarrativeStatus> {
|
||||
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 String toCode(NarrativeStatus code) throws IllegalArgumentException {
|
||||
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 "?";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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=-1, min=1, max=1)
|
||||
@Description(shortDefinition="generated | extensions | additional", 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<NarrativeStatus> status;
|
||||
|
||||
/**
|
||||
* The actual narrative content, a stripped down version of XHTML.
|
||||
*/
|
||||
@Child(name="div", type={}, order=0, min=1, max=1)
|
||||
@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;
|
||||
|
||||
public Narrative() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Narrative(Enumeration<NarrativeStatus> 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<NarrativeStatus> 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<NarrativeStatus>();
|
||||
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<NarrativeStatus> 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<NarrativeStatus>(NarrativeStatus.ENUM_FACTORY);
|
||||
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();
|
||||
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<Property> 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));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
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, Dec 7, 2014 21:45-0500 for FHIR v0.3.0
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.instance.model.annotations.Child;
|
||||
import org.hl7.fhir.instance.model.annotations.Description;
|
||||
import org.hl7.fhir.instance.model.annotations.DatatypeDef;
|
||||
/**
|
||||
* A human-readable formatted text, including images.
|
||||
*/
|
||||
@DatatypeDef(name="Narrative")
|
||||
public class Narrative extends Element {
|
||||
|
||||
public enum NarrativeStatus implements FhirEnum {
|
||||
/**
|
||||
* The contents of the narrative are entirely generated from the structured data in the resource.
|
||||
*/
|
||||
GENERATED,
|
||||
/**
|
||||
* The contents of the narrative are entirely generated from the structured data in the resource 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 for this resource".
|
||||
*/
|
||||
EMPTY,
|
||||
/**
|
||||
* added to help the parsers
|
||||
*/
|
||||
NULL;
|
||||
|
||||
public static final NarrativeStatusEnumFactory ENUM_FACTORY = new NarrativeStatusEnumFactory();
|
||||
|
||||
public static NarrativeStatus fromCode(String codeString) throws IllegalArgumentException {
|
||||
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 IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'");
|
||||
}
|
||||
@Override
|
||||
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 "";
|
||||
case EXTENSIONS: return "";
|
||||
case ADDITIONAL: return "";
|
||||
case EMPTY: return "";
|
||||
default: return "?";
|
||||
}
|
||||
}
|
||||
public String getDefinition() {
|
||||
switch (this) {
|
||||
case GENERATED: return "The contents of the narrative are entirely generated from the structured data in the resource.";
|
||||
case EXTENSIONS: return "The contents of the narrative are entirely generated from the structured data in the resource 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 for this resource'.";
|
||||
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<NarrativeStatus> {
|
||||
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 String toCode(NarrativeStatus code) throws IllegalArgumentException {
|
||||
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 "?";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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=-1, min=1, max=1)
|
||||
@Description(shortDefinition="generated | extensions | additional", 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<NarrativeStatus> status;
|
||||
|
||||
/**
|
||||
* The actual narrative content, a stripped down version of XHTML.
|
||||
*/
|
||||
@Child(name="div", type={}, order=0, min=1, max=1)
|
||||
@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;
|
||||
|
||||
public Narrative() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Narrative(Enumeration<NarrativeStatus> 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<NarrativeStatus> 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<NarrativeStatus>();
|
||||
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<NarrativeStatus> 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<NarrativeStatus>(NarrativeStatus.ENUM_FACTORY);
|
||||
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();
|
||||
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<Property> 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));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty())
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue